package com.freemalll.system.domain;

import java.util.Date;
import java.util.List;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.freemalll.common.core.annotation.Excel;
import com.freemalll.common.core.annotation.Excel.ColumnType;
import com.freemalll.common.core.web.domain.AuditEntity;

/**
 * 组织机构表 sys_organization
 * 
 * @author freemalll
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_organization")
public class SysOrganization extends AuditEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Excel(name = "主键ID", cellType = ColumnType.STRING)
    private String id;

    /** 机构地址 */
    @TableField("address")
    @Excel(name = "机构地址")
    @Size(min = 0, max = 300, message = "机构地址不能超过300个字符")
    private String address;

    /** 地区-区 */
    @TableField("area")
    @Excel(name = "地区-区")
    @Size(min = 0, max = 60, message = "地区-区不能超过60个字符")
    private String area;

    /** 地区-市 */
    @TableField("city")
    @Excel(name = "地区-市")
    @Size(min = 0, max = 60, message = "地区-市不能超过60个字符")
    private String city;

    /** 联系人 */
    @TableField("linkman")
    @Excel(name = "联系人")
    @Size(min = 0, max = 70, message = "联系人不能超过70个字符")
    private String linkman;

    /** 商标logourl */
    @TableField("logo")
    @Excel(name = "商标logo")
    @Size(min = 0, max = 100, message = "商标logo URL不能超过100个字符")
    private String logo;

    /** 移动电话 */
    @TableField("mobile")
    @Excel(name = "移动电话")
    @Size(min = 0, max = 20, message = "移动电话不能超过20个字符")
    private String mobile;

    /** 组织名称 */
    @TableField("org_name")
    @Excel(name = "组织名称")
    @NotBlank(message = "组织名称不能为空")
    @Size(min = 0, max = 32, message = "组织名称不能超过32个字符")
    private String orgName;

    /** 组织唯一编码 */
    @TableField("org_only_code")
    @Excel(name = "组织唯一编码")
    @Size(min = 0, max = 36, message = "组织唯一编码不能超过36个字符")
    private String orgOnlyCode;

    /** 组织状态 false 停用 true 启用 */
    @TableField("org_status")
    @Excel(name = "组织状态", readConverterExp = "true=启用,false=停用")
    private Boolean orgStatus;

    /** 组织机构类型编码 */
    @TableField("org_type_code")
    @Excel(name = "组织机构类型编码")
    @Size(min = 0, max = 60, message = "组织机构类型编码不能超过60个字符")
    private String orgTypeCode;

    /** 组织机构类型Id */
    @TableField("org_type_id")
    @Excel(name = "组织机构类型Id")
    @Size(min = 0, max = 32, message = "组织机构类型Id不能超过32个字符")
    private String orgTypeId;

    /** 父节点id */
    @TableField("parent_id")
    @Excel(name = "父节点id")
    private String parentId;

    /** 照片url */
    @TableField("photo")
    @Excel(name = "照片url")
    @Size(min = 0, max = 100, message = "照片URL不能超过100个字符")
    private String photo;

    /** 地区-省 */
    @TableField("province")
    @Excel(name = "地区-省")
    @Size(min = 0, max = 60, message = "地区-省不能超过60个字符")
    private String province;

    /** 是否区域管控 0 否 1是 */
    @TableField("region")
    @Excel(name = "是否区域管控", readConverterExp = "0=否,1=是")
    @Size(min = 0, max = 2, message = "是否区域管控不能超过2个字符")
    private String region;

    /** 座机 */
    @TableField("tel")
    @Excel(name = "座机")
    @Size(min = 0, max = 20, message = "座机不能超过20个字符")
    private String tel;

    /** oa系统分部主键id */
    @TableField("company_id")
    @Excel(name = "OA系统分部主键id")
    @Size(min = 0, max = 64, message = "OA系统分部主键id不能超过64个字符")
    private String companyId;

    /** oa系统部门主键id */
    @TableField("department_id")
    @Excel(name = "OA系统部门主键id")
    @Size(min = 0, max = 64, message = "OA系统部门主键id不能超过64个字符")
    private String departmentId;

    /** 是否OA同步 0 是 1 否 */
    @TableField("sync_status")
    @Excel(name = "是否OA同步", readConverterExp = "true=已同步,false=未同步")
    private Boolean syncStatus;

    /** 子部门列表（用于树形结构） */
    @TableField(exist = false)
    private List<SysOrganization> children;
}